<%@ page import="com.ciquan.server.util.web.BasePathUtil" %>
<%--
  Created by IntelliJ IDEA.
  User: kakalee
  Date: 15/1/24
  Time: 14:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="header.jsp"></jsp:include>
<script>
    $(document).ready(function(){
        $("#type").val('${advertisement.type}');
    });
</script>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <form role="form" action="/advertisement/saveEdit" method="post" enctype="multipart/form-data">
        <div class="panel panel-primary">
            <div class="panel-heading">编辑广告</div>
            <div class="panel-body">
                <div class="form-group">
                    <label>标题</label>
                    <input type="hidden" name="id" value="${advertisement.id}">
                    <input type="text" class="form-control user-form-control" name="title" value="${advertisement.title}" required="required">
                </div>

                <div class="form-group">
                    <label>地址</label>
                    <input type="text" class="form-control user-form-control" name="url" value="${advertisement.url}" required="required">
                </div>

                <div class="form-group">
                    <label>图片</label>
                    <input type="file" class="form-control user-form-control" name="file">
                </div>

                <div class="form-group">
                    <label>类型</label>
                    <select name="type" id="type">
                        <option value="0">焦点图</option>
                        <option value="1">启动图</option>
                    </select>
                </div>

                <div class="form-group">
                    <button class="btn btn-primary user-form-control" type="submit">添加</button>
                </div>
            </div>
        </div>
    </form>
</div>

</div>
</body>
</html>
